<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>作业4</title>
    <script src="js/vue.js"></script>
  </head>
  <body>
    <div id="root">
      <input @keyup="submit" />
      <p v-show="isClick">当前大写已打开!</p>
    </div>
    <script>
      const app = new Vue({
        el: "#root",
        data: {
          tip: "",
          isClick: false,
        },
        methods: {
          submit(e) {
            if (e.key === "CapsLock") {
                this.isClick = !this.isClick
            }
          },
        },
        onMouted() {},
      });
    </script>
  </body>
</html>